package com.atguigu.tingshu.order.rpc;

import com.atguigu.tingshu.common.result.Result;
import com.atguigu.tingshu.model.order.OrderInfo;
import com.atguigu.tingshu.order.service.OrderInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Description:
 *
 * @author Yanxinhao on 2025/2/13
 */
@RestController
@RequestMapping("/api/order/rpc")
public class RpcOrderApiController {

    @Autowired
    private OrderInfoService orderInfoService;


    @GetMapping("/getOrderInfoByOrderNo/{orderNo}")
    public Result<OrderInfo> getOrderInfoByOrderNo(@PathVariable String orderNo){
        OrderInfo orderInfo = orderInfoService.getOrderInfoAndDetail(orderNo);
        return Result.ok(orderInfo);
    }
}